package com.mmd.manage.vo;

import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;

import java.io.Serializable;
import java.util.List;

public class PageData<T> implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -1942903865918313044L;

    public PageData(PageInfo<T> result) {
        this.curPage = result.getPageNum();
        this.pageSize = result.getPageSize();
        this.total = result.getTotal();
        this.content = result.getList();
    }


    private Integer curPage;

    private Integer pageSize;

    private long total;

    private List<T> content = Lists.newArrayList();

    public PageData(List<T> content, long total, int pageSize, int curPage) {
        this.content = content;
        this.total = total;
        this.pageSize = pageSize;
        this.curPage = curPage;
    }

    public Integer getCurPage() {
        return curPage;
    }

    public void setCurPage(Integer curPage) {
        this.curPage = curPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<T> getContent() {
        return content;
    }

    public void setContent(List<T> content) {
        this.content = content;
    }
}
